package com.iraeta.entity.main;

import com.iraeta.entity.main.type.SrmMessageStatus;

import java.io.Serializable;
import java.util.Date;

/**
 * srmmessage
 * @author 
 */
public class Srmmessage implements Serializable {
    public Srmmessage() {
    }

    public Srmmessage(String companyname, Integer typeid, String typename, Long orderid, String msgdata) {
        this.companyname = companyname;
        this.typeid = typeid;
        this.typename = typename;
        this.orderid = orderid;
        this.msgdata = msgdata;
        this.createtime = new Date();
        this.statusid = SrmMessageStatus.unProcess;
        this.orderdata = "";
        this.errormsg = "";
    }

    /**
     * 消息id
     */
    private Long id;

    /**
     * 公司名称
     */
    private String companyname;

    /**
     * 消息类型
     */
    private Integer typeid;

    /**
     * 消息类型名称
     */
    private String typename;

    /**
     * 订单id
     */
    private Long orderid;

    /**
     * 处理状态
     */
    private Integer statusid;

    /**
     * 消息内容
     */
    private String msgdata;

    /**
     * 订单内容
     */
    private String orderdata;


    /**
     * 错误内容
     */
    private String errormsg;

    /**
     * 创建时间
     */
    private Date createtime;

    /**
     * 处理状态名称， 数据库没有改字段
     */
    private String statusname;


    /**
     * 自定义字段
     */
    private String cdefine1;

    /**
     * 自定义字段
     */
    private String cdefine2;

    private static final long serialVersionUID = 1L;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCompanyname() {
        return companyname;
    }

    public void setCompanyname(String companyname) {
        this.companyname = companyname;
    }

    public Integer getTypeid() {
        return typeid;
    }

    public void setTypeid(Integer typeid) {
        this.typeid = typeid;
    }

    public String getTypename() {
        return typename;
    }

    public void setTypename(String typename) {
        this.typename = typename;
    }

    public Long getOrderid() {
        return orderid;
    }

    public void setOrderid(Long orderid) {
        this.orderid = orderid;
    }

    public Integer getStatusid() {
        return statusid;
    }

    public void setStatusid(Integer statusid) {
        this.statusid = statusid;
    }

    public String getMsgdata() {
        return msgdata;
    }

    public void setMsgdata(String msgdata) {
        this.msgdata = msgdata;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public String getOrderdata() {
        return orderdata;
    }

    public void setOrderdata(String orderdata) {
        this.orderdata = orderdata;
    }

    public String getErrormsg() {
        return errormsg;
    }

    public void setErrormsg(String errormsg) {
        this.errormsg = errormsg;
    }

    public String getStatusname() {
        return statusname;
    }

    public void setStatusname(String statusname) {
        this.statusname = statusname;
    }

    public String getCdefine1() {
        return cdefine1;
    }

    public void setCdefine1(String cdefine1) {
        this.cdefine1 = cdefine1;
    }

    public String getCdefine2() {
        return cdefine2;
    }

    public void setCdefine2(String cdefine2) {
        this.cdefine2 = cdefine2;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTypeid() == null) ? 0 : getTypeid().hashCode());
        result = prime * result + ((getTypename() == null) ? 0 : getTypename().hashCode());
        result = prime * result + ((getOrderid() == null) ? 0 : getOrderid().hashCode());
        result = prime * result + ((getStatusid() == null) ? 0 : getStatusid().hashCode());
        result = prime * result + ((getMsgdata() == null) ? 0 : getMsgdata().hashCode());
        result = prime * result + ((getCreatetime() == null) ? 0 : getCreatetime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", typeid=").append(typeid);
        sb.append(", typename=").append(typename);
        sb.append(", orderid=").append(orderid);
        sb.append(", statusid=").append(statusid);
        sb.append(", msgdata=").append(msgdata);
        sb.append(", createtime=").append(createtime);
        sb.append(", cdefine1=").append(cdefine1);
        sb.append(", cdefine2=").append(cdefine2);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}